
/**		
 * 
 *	uk.co.lmfm.guppy.controller.SVNLogReportCommand
 *	
 *	@version 1.00 | Jan 13, 2010
 *	@author Justin Windle
 *  
 **/
 
package uk.co.lmfm.guppy.controller 
{
	import uk.co.lmfm.guppy.model.SettingsProxy;
	import uk.co.lmfm.guppy.model.SVNProxy;
	import uk.co.lmfm.net.subversion.vo.SVNLogReportVO;

	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;

	/**
	 * SVNLogReportCommand
	 */
	public class SVNLogReportCommand extends SimpleCommand implements ICommand 
	{
		/**
		 * notification.getName() == ApplicationConstants.SVN_LOG_REPORT_RECIEVED		 * notification.getBody() == SVNLogReportVO
		 */

		override public function execute(notification : INotification) : void
		{
			super.execute(notification);
			
			var report : SVNLogReportVO = notification.getBody() as SVNLogReportVO;
			
			var svnProxy : SVNProxy = facade.retrieveProxy(SVNProxy.NAME) as SVNProxy;
			var sqlProxy : SettingsProxy = facade.retrieveProxy(SettingsProxy.NAME) as SettingsProxy;
			
			svnProxy.checkout(report, sqlProxy.readSettings().libraryPath);
		}
	}
}
